package edu.drexel.jrexel2d.objects2D;

import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;

public class Backdrop {
	private int height;
	private Texture backdrop;
	private Point2D location;

	public void setLocation(Point2D location) {
		this.location = location;
	}

	public Backdrop(String name) {
		try {
			backdrop = TextureLoader.getTexture(
					"PNG",
					ResourceLoader.getResourceAsStream("assets/sprites/" + name
							+ "/back.png"));
		} catch (Exception e) {
			System.out.println("Error creating backdrop: " + e);
		}
		location = new Point2D(0, 0);
		height = backdrop.getImageHeight();
	}

	public Point2D getLocation() {
		return location;
	}

	public Texture getTex() {
		return backdrop;
	}

	public int getHeight() {
		return height;
	}

	public int getWidth() {
		return backdrop.getImageWidth();
	}

	public void setLocation(int x, int y) {
		location = new Point2D(x, y);
	}

	public void shift(int x, int y) {
		location.shift(x, y);
	}

}
